package com.cykj.order.mapper;

/**
 * @BelongsProject: Cykj-Order-System
 * @BelongsPackage: com.cykj.order.mapper
 * @Author: cwx
 * @CreateTime: 2025/9/4 12:01
 * @Description:
 * @Version: 1.0
 */


import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.cykj.order.domain.BsOrders;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

/**
 * 订单主表Mapper（自定义方法）
 */
@Mapper
public interface BsOrdersMapper extends BaseMapper<BsOrders> {

    /**
     * 根据订单编号查询订单（防重复创建）
     */
    BsOrders selectByOrderNumber(@Param("orderNumber") String orderNumber);

    /**
     * 超时取消订单（更新状态和取消原因）
     */
    int cancelOrderByTimeout(@Param("orderId") Long orderId, @Param("cancelReason") String cancelReason);

}